/**
 * FileName: MqttsGateway
 * Author: Wb
 * Date: 2025/9/25 13:57
 * Description:
 * History:
 */
package org.test.device.config.mqtt;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;

/**
 * 〈一句话功能简述〉<br>
 * 〈通过网关将消息发送到 `mqttOutboundChannel`〉
 *
 * @author Wb
 * @create 2025/9/25
 * @since 1.0.0
 */
@MessagingGateway(defaultRequestChannel = "mqttOutboundChannel")
public interface MqttGateway {

    /**
     * @Author Wb
     * @Description 使用默认主题发送
     * @Date 13:59 2025/9/25
     */
    void sendMessageToMqtt(String payload);

    /**
     * @Author Wb
     * @Description 指定主题发送
     * @Date 13:59 2025/9/25
     */
    void sendMessageToMqtt(@Header(MqttHeaders.TOPIC)String topic, String payload);

    /**
     * @Author Wb
     * @Description 指定主题与 QoS 发送
     * @Date 14:01 2025/9/25
     */
    void sendMessageToMqtt(@Header(MqttHeaders.TOPIC)String topic,
                           @Header(MqttHeaders.QOS)int qos,
                           String payload);
}